package mx.com.switz.controller;

import java.util.List;

import mx.com.switz.dto.Carrera;
import mx.com.switz.service.CarreraService;
import org.springframework.web.servlet.ModelAndView;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("carrera")
public class CarreraController {
	
	@Autowired
	private CarreraService carreraService;
	
	@RequestMapping("muestraPagina")
	public String mostrar(){
		return "carrera/mostrar";
	}
	
	@RequestMapping("carreras")
	public ModelAndView carreras(){
		List<Carrera> carreras=carreraService.mostrarCarreras();
		return new ModelAndView("carrera/mostrar",
				"carreras", carreras);
		
	}

}
